﻿#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define SIZE 40
#define LIM 5
int main(){
	char qword[LIM][SIZE];
	char temp[SIZE];
	printf("please enter %d words begining with q:\n", LIM);
	for (size_t i = 0; i < LIM; )
	{
		gets(temp);
		if (temp[0]!='q')
		{
			printf("%s doesn't begin with q!\n", temp);
		}
		else
		{
			strcpy(qword[i], temp);
			i++;
		}
	}
	printf("here are the words accepted:\n");
	for (size_t i = 0; i < LIM; i++)
	{
		puts(qword[i]);
	}
	system("pause");
	return 0;
}